package xiaopiya.robot.handler.weather;

import xiaopiya.robot.handler.AbstractMessageHandler;

/**
 * @author Ray (ayufox@gmail.com)
 * @version 0.1
 */
public class WeatherMessageHandler extends AbstractMessageHandler
{
	private IWeatherService weatherService;

	public void setWeatherService(IWeatherService weatherService)
	{
		this.weatherService = weatherService;
	}

	/* (non-Javadoc)
	 * @see xiaopiya.robot.handler.AbstractMessageHandler#handle(java.lang.String, java.lang.String)
	 */
	protected String handle(String from, String city)
	{
		if (LOG.isInfoEnabled())
		{
			LOG.info("getweather for city[" + city + "]");
		}
		return weatherService.getWeather(city);
	}
}
